<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>combotree</title>
    <link rel="stylesheet" type="text/css" href="/easyui.css">
    <link rel="stylesheet" type="text/css" href="/icon.css">
    <link rel="stylesheet" type="text/css" href="/demo.css">
    <script src="/jquery.min.js"></script>
    <script src="/jquery.easyui.min.js"></script>
</head>
<body>
<h2>ComboTree Actions</h2>
<p>Click the buttons below to perform actions</p>
<div style="margin: 20px 0">
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="getValue()">GetValue</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="setValue()">SetValue</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="disable()">Disable</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="enable()">Enable</a>
</div>

<div class="easyui-panel" style="width:100%;max-width:400px;padding:30px 60px;">
    <!--加载了一个面板-->
<input id="cc" value="01" style="width: 80%">
<script type="text/javascript" >
    $("#cc").combotree({
        label:'width: 80%',
        labelPosition:'top',
        required:true
    });
    $("#cc").combotree('loadData', [{
        id: 1,
        text: 'Languages',
        children: [{
            id: 11,
            text: 'Java'
        },{
            id: 12,
            text: 'C++'
        }]
    }]);
    $("#cc").combotree('loadData', [{
        id: 1,
        text: 'Languages1',
        children: [{
            id: 11,
            text: 'Java'
        },{
            id: 12,
            text: 'C++'
        }]
    }, {
            id: 2,
            text: 'Languages2',
            children: [{
                id: 21,
                text: 'Java'
            },{
                id: 22,
                text: 'C plus'
            }]
        }
    ]);
</script>
</div>
<script type="text/javascript">
    function getValue(){
        var val = $('#cc').combotree('getValue');
        alert(val);
    }
    function setValue(){
        $('#cc').combotree('setValue', '22');
    }
    function disable(){
        $('#cc').combotree('disable');
    }
    function enable(){
        $('#cc').combotree('enable');
    }
</script>

</body>
</html>